package 文件;

import java.io.*;

/**
 * @author: yangwk
 * @date: 2023/5/10
 * @description:
 **/
public class 随机位置 {
    public static void main(String[] args) throws IOException {
        RandomAccessFile randomAccessFile = new RandomAccessFile("E:\\ideaWorkspace\\practice-code\\JavaEssential\\java-practice\\src\\Java基础\\文件\\A.txt", "r");
        System.out.println(randomAccessFile.length());
        randomAccessFile.seek(3);
        int a= randomAccessFile.readByte();

        FileInputStream fileInputStream = new FileInputStream(new File("E:\\ideaWorkspace\\practice-code\\JavaEssential\\java-practice\\src\\Java基础\\文件\\B.txt"));
        System.out.println(fileInputStream.available());
        fileInputStream.skip(3);
        int b= fileInputStream.read();

        System.out.println(a+"");
        System.out.println(b);

    }
}
